package com.lb.service;

import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Component;

@Component
public class AsyncExecutorTask extends AbstractTask {

    @Async("taskExecutor")
    public void doTaskOneCallback() throws Exception {

        super.doTaskOne();
        System.out.println("任务一，当前线程：" + Thread.currentThread().getName());
    }

    @Async("taskExecutor")
    public void doTaskTwoCallback() throws Exception {

        super.doTaskTwo();
        System.out.println("任务二，当前线程：" + Thread.currentThread().getName());
    }

    @Async("taskExecutor")
    public void doTaskThreeCallback() throws Exception {

        super.doTaskThree();
        System.out.println("任务三，当前线程：" + Thread.currentThread().getName());
    }

}